package com.csi.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.sql.Timestamp;

/**
 * 员工表
 */
@Data
@Schema(description = "员工信息模型")
public class Employee {

    @Schema(description = "员工的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private long id; // 员工id

    @Schema(description = "员工用户名", requiredMode = Schema.RequiredMode.REQUIRED, example = "user123")
    private String username; // 员工用户名

    @Schema(description = "员工密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "password123")
    private String password; // 员工密码

    @Schema(description = "员工姓名", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
    private String name; // 员工姓名

    @Schema(description = "员工手机号", requiredMode = Schema.RequiredMode.REQUIRED, example = "13800001234")
    private String phone; // 员工手机号

    @Schema(description = "员工身份证号", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456789012345678")
    private String idCard; // 员工身份证号

    @Schema(description = "员工地址", example = "北京市朝阳区某街道123号")
    private String userAddress; // 员工地址

    @Schema(description = "入职时间", requiredMode = Schema.RequiredMode.REQUIRED,
            type = "string", format = "date", example = "2024-01-15")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd") // 转换时间格式
    private Timestamp entryTime; // 入职时间

    @Schema(description = "离职时间", type = "string", format = "date", example = "2024-12-31")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Timestamp leaveTime; // 离职时间

    @Schema(description = "性别", requiredMode = Schema.RequiredMode.REQUIRED, example = "1", allowableValues = "0, 1")
    private int sex; // 性别，假设0为女性，1为男性

    @Schema(description = "入职办理人ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    private long createId; // 入职办理人id

    @Schema(description = "关联的酒店ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3")
    private long hotelId; // 酒店id

    @Schema(description = "离职处理人ID", example = "4")
    private long handleId; // 离职处理人id

    @Schema(description = "角色ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5")
    private long roleId; // 角色id
}